/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.cobranza.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;

/**
 *
 * @author Hvives
 */
@Entity
@Table(name = "TCOB_PAGOS")
public class PagoDto implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_TCOB_PAGOS")
    @TableGenerator(name = "SEQ_TCOB_PAGOS", table = "TCORE_ENTIDAD", pkColumnName = "NOMBRE", valueColumnName = "CORRELATIVO", pkColumnValue = "TCOB_PAGOS", allocationSize = 1)
    private Long id;
    @JoinColumn(name = "DEUDA_CLIENTE", referencedColumnName = "ID")
    @ManyToOne
    private DeudaClienteDto deudaClienteDto;
    @Column(name = "MONTO")
    private BigDecimal monto;
    @Column(name = "FECHA")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Size(max = 20)
    @Column(name = "MONEDA")
    private String moneda;
    @Size(max = 200)
    @Column(name = "COMENTARIOS")
    private String comentarios;
    @Size(max = 200)
    @Column(name = "CODIGO_PRODUCTO")
    private String codigoProducto;
    @Column(name = "NUMERO_OPERACION")
    private Long numeroOperacion;

    public PagoDto() {
    }

    public PagoDto(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public DeudaClienteDto getDeudaClienteDto() {
        return deudaClienteDto;
    }

    public void setDeudaClienteDto(DeudaClienteDto deudaClienteDto) {
        this.deudaClienteDto = deudaClienteDto;
    }

    public BigDecimal getMonto() {
        return monto;
    }

    public void setMonto(BigDecimal monto) {
        this.monto = monto;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getMoneda() {
        return moneda;
    }

    public void setMoneda(String moneda) {
        this.moneda = moneda;
    }

    public String getComentarios() {
        return comentarios;
    }

    public void setComentarios(String comentarios) {
        this.comentarios = comentarios;
    }

    public Long getNumeroOperacion() {
        return numeroOperacion;
    }

    public void setNumeroOperacion(Long numeroOperacion) {
        this.numeroOperacion = numeroOperacion;
    }

    public String getCodigoProducto() {
        return codigoProducto;
    }

    public void setCodigoProducto(String codigoProducto) {
        this.codigoProducto = codigoProducto;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PagoDto)) {
            return false;
        }
        PagoDto other = (PagoDto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.brain.cobranza.dto.PagoDto[ id=" + id + " ]";
    }
}
